const express = require('express')
const router = express.Router()
const { DataETLController } = require('../controller/data_etl')
const authMiddleware = require('../middleware/auth')
router.post(
  '/v1/dataETL/add',
  authMiddleware,
  DataETLController.dataETLAdd
)
router.put(
  '/v1/dataETL/edit',
  authMiddleware,
  DataETLController.dataETLUpd
)
router.delete(
  '/v1/dataETL/del',
  authMiddleware,
  DataETLController.dataETLDel
)
router.get(
  '/v1/dataETL/list',
  authMiddleware,
  DataETLController.dataETLList
)
router.get(
  '/v1/dataETL/all',
  authMiddleware,
  DataETLController.dataETLAllList
)
router.post(
  '/v1/dataETL/saveDraft',
  authMiddleware,
  DataETLController.dataETLSaveDraft
)
router.get(
  '/v1/dataETL/detail',
  authMiddleware,
  DataETLController.dataETLByID
)
router.get(
  '/v1/dataETL/mysql/tables',
  authMiddleware,
  DataETLController.dataETLMysqlTables
)

router.get(
  '/v1/dataETL/mysql/fields',
  authMiddleware,
  DataETLController.dataETLMysqlFields
)

router.post(
  '/v1/dataETL/table/data',
  authMiddleware,
  DataETLController.dataETLTableData
)
router.post(
  '/v1/dataETL/node/data',
  authMiddleware,
  DataETLController.dataETLNodeData
)
router.post(
  '/v1/dataETL/saveAndRun',
  authMiddleware,
  DataETLController.dataETLSaveAndRun
)
router.post(
  '/v1/dataETL/etl/exec',
  authMiddleware,
  DataETLController.dataETLExec
)
module.exports = router
